<!--#include File="Include.asp"--><%
'--------------------------------------
'Power By 方卡在线 @2010-2014 f02
'URL:http://www.fangka.net/
'EMail:admin@ifangka.com
'QQ:861118936
'版权所有 未经允许不得去除本版权信息
'--------------------------------------

Call CheckAdminType("0,1",UType)

Types=Clng(Request.QueryString("Type"))

Select Case Types
	Case 1
		Call GetModelList()
	Case 101
		Call t_GetModuleList()
End Select

'==========================================
'获取模型
'==========================================
Function GetModelList()
	Id=Clng(Trim(Request.QueryString("m")))
	Sqlstr="Select Fk_Model_Id,Fk_Model_Name From [Fk_Model] Where Fk_Model_Type="&Id&" And Fk_Model_State=1 Order By Fk_Model_Id Desc"
	Rs.Open Sqlstr,Conn,1,1
	While Not Rs.Eof
		If Temp="" Then
			Temp=Rs("Fk_Model_Id")&"|||||"&Rs("Fk_Model_Name")
		Else
			Temp=Temp&",,,,,"&Rs("Fk_Model_Id")&"|||||"&Rs("Fk_Model_Name")
		End If
		Rs.MoveNext
	Wend
	Rs.Close
	Response.Write(Temp)
End Function

'==========================================
'获取栏目列表
'==========================================
Function t_GetModuleList()
	Id=Trim(Request.QueryString("Id"))
	Temp=Trim(Request.QueryString("List"))
	If Temp="list" Then
		Temp="0|||||一级栏目,,,,,{$ModuleId$}|||||当前栏目"
	Else
		Temp=""
	End If
	If IsNumeric(Id) Then
		Id=Clng(Id)
		Temp=Temp&t_GetModuleList_m(Id,0,"")
	End If
	Response.Write(Temp)
End Function

'==========================================
'获取栏目列表内循环
'==========================================
Function t_GetModuleList_m(m_Id,g_Id,g_Title)
	Dim Rst,tryTitle
	If g_Title="" Then
		tryTitle="--├"
	Else
		tryTitle="----"&g_Title
	End If
	Set Rst=Server.Createobject("Adodb.RecordSet")
	Sqlstr="Select Fk_Module_Id,Fk_Module_Name From [Fk_Module] Where Fk_Module_Menu="&m_Id&" And Fk_Module_Level="&g_Id&" And Fk_Module_State=1 Order By Fk_Module_Order Asc,Fk_Module_Id Asc"
	Rst.Open Sqlstr,Conn,1,1
	While Not Rst.Eof
		t_GetModuleList_m=t_GetModuleList_m&",,,,,"&Rst("Fk_Module_Id")&"|||||"&g_Title&Rst("Fk_Module_Name")
		t_GetModuleList_m=t_GetModuleList_m&t_GetModuleList_m(m_Id,Rst("Fk_Module_Id"),tryTitle)
		Rst.MoveNext
	Wend
	Rst.Close
End Function
%>